/**
 * @author mapeng
 * @version 2017-06-02
 */

;(function(doc, win) {

	$(doc).on("pageInit", "#myDetailPage", function(e, pageId, $page, isBack,isForward) {
		if(isBack || isForward)	return;

		initData4Page();
	});
	bindEvent4Page();

	function initData4Page(){

		CommonUtil.sendJsonpRequest({
		// testApi.testGetUserInfo({
			"url" : App.serverUrl+"/app/employee/info.do",
			"params" : {},
			"success" : function(result){
				if(result.success.toString() == "true"){//success
					CommonUtil.render($("#myDetailPage .page-body"), "myDetailTPL",{"data":result.resultObject},false);
				}else{//business error
					DialogUtil.dialogWarn(result.msg);
				}
			},
			"error" : function(){//not 200
				DialogUtil.dialogWarn("请求失败，请稍候重试");
			}
		});
	}

	function bindEvent4Page(){

		
	}

	var testApi = {
		"testGetUserInfo" : function(options){
			options.success({
				"success" : true,
				"resultObject" : {
					"mobile" : "18612536832",
					"name" : "张三",
					"code" : "20004",
					"affiliationName" : "总部",
					"roleName" : "老板"
				}
				
			});
		}
	};

})(document, window);